package com.itheima;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

public class MyService {
    // 推荐使用SLF4J的Logger接口
    private static final Logger logger = LoggerFactory.getLogger(MyService.class);
    
    public void doWork() {
        MDC.put("TraceID", "1151515");
        MDC.put("traceId", "1151515mm");

        logger.error("error");
        logger.debug("debug");
        logger.info("info");
        logger.trace("trace");
        logger.warn("warn");
        logger.error("error {}", "param");
    }

    public static void main(String[] args) {
        new MyService().doWork();
    }
}
